<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<th:block th:fragment="menu">
    <div class="am-collapse am-topbar-collapse rb-topnav" id="doc-topbar-collapse-1">
        <ul class="am-nav am-nav-pills am-topbar-nav rb-pagenav">

            <div class="item" th:each="m: ${menus}">
                <a th:href="${m.href}" th:text="${session.lang == 'en' ? m.titleEn : m.title}">AI工业机器人</a>
                <ul class="twoList" th:if="${m.children != null && !m.children.isEmpty()}">
                    <li th:each="mc: ${m.children}"><a th:href="${mc.href + '?id=' + mc.id}" th:text="${session.lang == 'en' ? mc.titleEn : mc.title}">装卸机器人</a></li>

                </ul>
            </div>

            <div class="item">
                <span class="country-tel"><th:block th:text="${i18n.key47}"></th:block>：<th:block th:text="${companyProfile.serviceHotline}"></th:block></span>
            </div>
        </ul>
        <script>
            $(function () {
                $(".rb-topnav .rb-pagenav .item").hover(function () {
                    $(this).find('.twoList').stop().slideDown()
                }, function () {
                    $(this).find('.twoList').stop().slideUp()
                })
            })
        </script>
        <div class="am-fr rb-search">
            <a href="javascript:;" class="am-fr rb-language my-lang">
                <span lang="zh">简</span>
                <i style="margin:0 4px;font-style:normal;">/</i>
                <span lang="en">EN</span>
            </a>
            <script src="/statics/js/classie.js"></script>
            <script>
                var _paths = location.pathname.split('/')
                var _pathname = _paths[_paths.length - 1]
                if (_pathname == 'about-us.html') {
                    $('.am-topbar-nav .item').eq(1).find('a').addClass('rb-active')
                } else if (_pathname == 'parallel-robot.html') {
                    $('.am-topbar-nav .item').eq(2).find('a').addClass('rb-active')
                } else if (_pathname == 'visual-inspection.html') {
                    $('.am-topbar-nav .item').eq(3).find('a').addClass('rb-active')
                } else if (_pathname == 'automation.html') {
                    $('.am-topbar-nav .item').eq(4).find('a').addClass('rb-active')
                } else if (_pathname == 'join-us.html') {
                    $('.am-topbar-nav .item').eq(7).find('a').addClass('rb-active')
                } else if (_pathname == 'new-list.html') {
                    $('.am-topbar-nav .item').eq(6).find('a').addClass('rb-active')
                } else if (_pathname == 'client.html') {
                    $('.am-topbar-nav .item').eq(5).find('a').addClass('rb-active')
                } else {
                    $('.am-topbar-nav .item').eq(0).find('a').addClass('rb-active')
                }
            </script>
        </div>
    </div>
    <script type="text/javascript">
        $(function(){
            $('.my-lang span').click(function(){
                var lang = $(this).attr('lang');
                $.get('/setLanguage', {"lang": lang}, function(){
                    window.location.reload();
                })
            });
        })
    </script>
</th:block>